import 'package:flutter/material.dart';

class CommonDetailMain extends StatelessWidget {
  final String titleOne;
  final String titleTwo;

  const CommonDetailMain({Key key, this.titleOne, this.titleTwo})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (titleOne == null || titleTwo == null) return Container();
    return Container(
      //获取屏幕宽度 (MediaQuery.of(context).size.width - 3 * 10.0)
      width: (MediaQuery.of(context).size.width - 3 * 10.0) / 2,
      height: 40.0,
      margin: EdgeInsets.only(left: 10.0),
      child: Row(
        children: [
          Text(titleOne + ":",
              style:
                  TextStyle(color: Colors.black, fontWeight: FontWeight.w500)),
          Padding(
            padding: EdgeInsets.only(left: 10.0),
          ),
          Text(titleTwo,
              style:
                  TextStyle(color: Colors.black, fontWeight: FontWeight.w500))
        ],
      ),
    );
  }
}
